let myname: string = 'chuci'
//  myname = 123
let myshow: boolean = true
// myshow = 0
let my: string | number = 123
my = '123'
my = 111
// my = true
let list: number[] = [1, 2,3 ,4]
list.push(55) // error: Argument of type 'string' is not assignable to parameter of type 'number'.ts(2345)
let list2: (number | string)[] = [11, 22, '33', 44]
console.log(list2) //  [11, 22, '33', 44]
const student = {
    name: '李白',
    age: 18
}
console.log(student.age)
interface IObj {
    name: string,
    age: number,
    location: string
}
const obj1:IObj = {
    name: '黎明',
    age: 18,
    location: '顶多'
}
// 对于后端返回数据进行检验
interface IObdata {
    name: string,
    age: number,
    location: string,
    [propName: string]: any
}
const obj2:IObdata = {
    name: '黎明',
    age: 18,
    location: '顶多',
    city: '北极'
}
console.log(obj2.age, obj2.city)
export default{
}